//下载express  npm i express -S
const express = require('express')
const cors = require("cors")
const app = express()
const fs = require('fs')
const path = require('path')

app.use(cors())
const port = 3000
const csv = require('csvtojson')
 

app.get('/', (req, res) => {
  const converter = csv().fromFile('./data.csv')
    .then((json) => {
        res.send(json)
    })
})
app.listen(port, () => console.log(`Server running at  http://127.0.0.1:${port}`))